Release 10.1A: OpenEdge Development:
Web Services
Complex data types
Complex data types in XML appear in many forms, but share a common feature of representing multiple simple and other complex data types as an aggregate (group). One of the most common complex data types in XML is the XML Schema complex type. An XML Schema complex type is an aggregate of one or more simple types or complex types defined by an enclosing
<complexType>XML Schema element. Other forms of complex data, specified by other types of XML elements, can also appear in SOAP messages, such as the<ProTempTable>element in theurn:progress-datasetnamespace or XML forms of the Microsoft DataSet.When the WSDL Analyzer encounters a Web service operation parameter defined with a complex data type, it attempts to identify a Progress 4GL data type to represent the parameter that both maps to the parameter exactly and provides the easiest access to the data in the Progress 4GL. Thus, the Analyzer might suggest any of the following parameter data types to represent:
In all cases, OpenEdge passes complex data type parameters between SOAP messages and the Progress 4GL as strings in serialized (well-formed XML) form for both input and output.
Once in the Progress 4GL, you can work with data from Web service complex data types using the features of the 4GL data type used to represent it. For example, if the Analyzer determines that you can represent a Web service parameter as a temp-table or ProDataSet, you can access the data as a temp-table or ProDataSet with no need to manipulate the SOAP message XML. OpenEdge allows some flexibility in how the simple XML Schema data types of individual data elements map to the Progress 4GL fields in a temp-table. The casting rules for these mappings are similar to those for simple data type parameters (see the "Simple data types" section). For more information, see the sections on mapping between XML Schema and Progress temp-table field data types, in OpenEdge Development: Programming Interfaces . For more information on how the WSDL Analyzer analyzes and documents complex data that maps to temp-tables and ProDataSets, see the "Analyzing complex data" section.
If the Analyzer can only represent the parameter as a
LONGCHARorCHARACTER(the most likely scenario), you must do one of the following:
- Directly manipulate the serialized XML, as specified by the Analyzer, in Progress 4GL
CHARACTERorLONGCHARvariables.- Convert the serialized XML to a parsed representation using the Progress 4GL SAX or DOM read and write methods. For more information, see OpenEdge Development: Programming Interfaces .
Whatever technique you use to work directly with the XML for a complex data type parameter in the Progress 4GL, if you need to pass the parameter back as input to the Web service, you must pass it back as serialized XML. So, if you maintain the data for complex types in a Progress 4GL DOM tree (de-serialized) or read it as a stream using SAX, you must serialize it again to a string before passing it back to a Web service as a complex data type parameter. You can do this from a DOM tree, by using a DOM method to convert the DOM tree to a character string, and you can do this in SAX by using SAX write methods to create the XML character string that you use for input.
For more information on how to manage complex data types as input and output parameters of Web service operations and work with the data in the Progress 4GL, see Chapter 10, " Invoking Web Service Operations from the Progress 4GL."
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |